Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enhance error message clarity and verbosity [ROW-252] #160

Merged
merged 8 commits into from
Jul 29, 2024

Conversation

RgnDunes
Copy link
Collaborator

@RgnDunes RgnDunes commented Jul 2, 2024

Description

This pull request refactors the error messages throughout the codebase to be more verbose and descriptive. The changes aim to provide clearer and more detailed information about the errors, making it easier for developers to understand what went wrong and how to fix it.

Changes include:

  • Updated all throw new Error statements to include detailed descriptions of the error conditions.
  • Included specific invalid values in the error messages for better debugging.
  • Added guidance in the error messages on what constitutes valid inputs.
  • Ensured consistency in the format and wording of error messages across different modules.

Changes Made

List the main changes made in this pull request.

Title ---
JIRA link https://razorpay.atlassian.net/browse/ROW-252
Slack thread (if any) https://razorpay.slack.com/archives/C072GV03Z6D/p1719845063234929?thread_ts=1719492341.561969&cid=C072GV03Z6D
Product spec NA
Tech spec/One-pager NA
Bundle Size Difference NA
Fixes Issue NA

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • This change is a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Is your change backward compatible ?
  • Tested on major browsers (Chrome, Firefox, Safari, IE) ?
  • Tested in a consumer application(s) ?

Additional Notes

Any additional information that would be helpful for the reviewer.

Checklist:

  • Add Jira ID(s) in PR title and in the description?
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My code is written in TypeScript and follows the coding standards of the project.
  • I have added relevant documentation and updated the README if necessary.
  • My commit messages are clear and follow the project's commit message conventions.
  • Is any external library added?
  • My changes do not introduce any new runtime errors or warnings.
  • All relevant unit tests have been added/updated in my PR for the change.
  • Any Screenshots (mobile & desktop) required for PR? If yes, have you added the respective screenshots ?
  • Any manual dev testing done by you on beta/func environment?
  • Reviewer added (SLA 2 days)

Reviewer Checklist

  • Sufficient QA/Dev-Testing is done with proof (test cases list)
  • Ensure that the change in bundle size falls within the acceptable range.

PR Title Format

Format: <type>: <subject>

Types can be as follows:

  • feat: (new feature for the user, not a new feature for build script)
  • fix: (bug fix for the user, not a fix to a build script)
  • docs: (changes to the documentation)
  • style: (formatting, missing semi colons, etc; no production code change)
  • refactor: (refactoring production code, eg. renaming a variable)
  • test: (adding missing tests, refactoring tests; no production code change)
  • chore: (updating grunt tasks etc; no production code change)

Copy link

changeset-bot bot commented Jul 2, 2024

🦋 Changeset detected

Latest commit: fe66808

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@razorpay/i18nify-js Minor
@razorpay/i18nify-react Major
i18nify-playground Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@RgnDunes RgnDunes requested a review from tarun-khanna July 2, 2024 21:29

This comment has been minimized.

This comment has been minimized.

@rzpcibot
Copy link
Contributor

rzpcibot commented Jul 2, 2024

Bundle Size Report

Files

click to expand/collapse
🟢 No Change 🗑 File Deleted 🆕 New File 📈 Size Increased 👍 Size Reduced
Parsed (kb)
🚦 File Name Base PR Diff %
📈 cjs/index.js 154.02 158 $\textcolor{red}{3.98}$ 2.58
📈 esm/index.min.js 56.25 60.11 $\textcolor{red}{3.86}$ 6.86
📈 umd/index.js 175.15 179.13 $\textcolor{red}{3.98}$ 2.27

Generated by 🚫 dangerJS against fe66808

This comment has been minimized.

@codecov-commenter
Copy link

codecov-commenter commented Jul 2, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 80.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 96.59%. Comparing base (b341faa) to head (fe66808).

Files Patch % Lines
...ules/.internal/utils/getIntlInstanceWithOptions.ts 50.00% 1 Missing ⚠️
...es/i18nify-js/src/modules/currency/formatNumber.ts 50.00% 1 Missing ⚠️
...ify-js/src/modules/currency/formatNumberByParts.ts 50.00% 1 Missing ⚠️
.../i18nify-js/src/modules/dateTime/formatDateTime.ts 50.00% 1 Missing ⚠️
...i18nify-js/src/modules/dateTime/getRelativeTime.ts 50.00% 1 Missing ⚠️
...ges/i18nify-js/src/modules/dateTime/getWeekdays.ts 50.00% 1 Missing ⚠️
...s/i18nify-js/src/modules/dateTime/parseDateTime.ts 50.00% 1 Missing ⚠️
packages/i18nify-js/src/modules/dateTime/utils.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #160      +/-   ##
==========================================
- Coverage   96.70%   96.59%   -0.12%     
==========================================
  Files          51       51              
  Lines         699      704       +5     
  Branches      171      173       +2     
==========================================
+ Hits          676      680       +4     
- Misses         23       24       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This comment has been minimized.

.changeset/mighty-oranges-behave.md Outdated Show resolved Hide resolved
if (!locale) throw new Error('Pass valid locale !');
if (!locale)
throw new Error(
`The provided locale value is invalid. The received value was: ${locale}. Please ensure you pass a correct locale string for proper formatting.`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's attach a link for valid locale list too ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have any such list maintained in our codebase.

This comment has been minimized.

This comment has been minimized.

@RgnDunes RgnDunes requested a review from tarun-khanna July 26, 2024 04:59
@RgnDunes RgnDunes merged commit 228ad00 into master Jul 29, 2024
23 checks passed
@RgnDunes RgnDunes deleted the row-252 branch July 29, 2024 10:16
Copy link
Contributor

Unit Test Results

0 files  ±0  0 suites  ±0   0s ⏱️ ±0s
0 tests ±0  0 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 228ad00. ± Comparison against base commit b341faa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants